import AIA
import AIB
import bobozan as bbz
import json

PlayerA = bbz.Player()
PlayerB = bbz.Player()
turn = 1
PlayerA.powerup(turn)
PlayerB.powerup(turn)
turn = turn + 1
A, B, result = 0, 0, 0

while (turn < 100) & (abs(result) < 2):
    A = AIA.AI(PlayerA, PlayerB, turn)
    B = AIB.AI(PlayerB, PlayerA, turn)
    turn = turn + 1
    result = A - B

data = {
    'A': PlayerA.recode[1:turn + 1],
    'B': PlayerB.recode[1:turn + 1],
    'result': result
}

print(json.dumps(data))
